Motion image recording device

ABSTRACT

A digital video camera ( 10 ) includes a CPU ( 52 ) mounting a multitasking OS. A plurality of frames of YUV data forming a motion image are recorded in a recording medium ( 50 ) in a compressed manner under the control of the CPU  52 . Here, a plurality of tasks to be executed by the CPU ( 52 ) includes an imaging processing task in relation to a compression process of the plurality frames of the YUV data and a BG processing task in relation to a recording process of a plurality of frames of JPEG data. Furthermore, the imaging processing task includes a determining process for periodically determining a recording processing speed of the JPEG data and a changing process for changing a compression ratio of the YUV data on the basis of the determination result.

TECHNICAL FIELD

The present invention relates to motion image recording apparatuses.More specifically, the present invention relates to a motion imagerecording apparatus that is applied to a video camera, and stores amotion image signal in a recording medium in a compressed manner.

PRIOR ART

An example of such a kind of conventional video camera is disclosed in aJapanese Patent Laying-open No.2000-184330 laid-open on Jun. 30, 2000.According to this prior art, a compression ratio of a still image signalof a next frame is calculated on the basis of a compression ratio, acompression size, and a target size of a still image signal of a currentframe forming a motion image, and whereby, a time period required for acompression process of each frame is shortened.

However, in the prior art, a target size is fixed, and therefore, withrespect to a recording medium of a low recording speed, it takes toomuch time to record a compressed still image signal of each frame. Thatis, in the prior art, there is a problem that a successive recordabletime period of a motion image depends on recording characteristics of arecording medium.

SUMMARY OF THE INVENTION

Therefore, it is a primary object of the present invention to provide amotion image recording apparatus capable of controlling a successiverecordable time of a motion image.

A motion image recording apparatus according to this invention isprovided with a processor mounting a multitasking OS, and records amotion image signal in a compressed manner in a recording medium,wherein a plurality of tasks to be executed by the processor includes afirst task in relation to a compression process of the motion imagesignal, and a second task in relation to a recording process of acompressed motion image signal, wherein the first task includes adetermining process for periodically determining a recording processingspeed of the compressed motion image signal and a changing process forchanging a compression ratio of the motion image signal on the basis ofa determination result of the determining process.

The motion image signal is recorded in the recording medium in acompressed manner under the control of the processor mounting amultitasking OS. Here, the plurality of tasks to be executed by theprocessor includes the first task in relation to the compression processof the motion image signal and the second task in relation to therecording process of the compressed motion image signal. Furthermore,the first task includes the determining process for periodicallydetermining the recording processing speed of the compressed motionimage signal, and a changing process for changing the compression ratioof the motion image signal according to the determination result.

In the multitasking OS, each of the plurality of tasks is executed onlyin a time division manner. Then, the recording processing speed of thecompressed image signal is changed according to load changes of each ofthe tasks. Here, this is the reason why the recording processing speedis periodically determined, and the compression ratio of the motionimage signal is changed according to the determination result. Thus, itis possible to control a successive recordable time of the motion image.

Preferably, the second task includes a transmission process fortransmitting the compressed motion image signal to the recording mediumby a defined amount. When another task is executed, the second task isinterrupted each time that a transmission by the defined amount iscompleted.

In a case that the motion image signal is fetched according to afetching condition of the motion image signal, the plurality of tasksfurther includes a third task in relation to an adjustment of thefetching condition. In a case that the fetching condition is controlledby the third task, the adjustment process becomes a change factor of therecording processing speed.

Preferably, the fetching means includes an imaging means for imaging anobject, and the fetching condition includes an imaging condition of theimaging means. In this case, whether or not an adjustment of the imagingcondition is necessary depends on an external factor such as brightness,tone, etc. of an object. The third task is activated at an arbitrarytiming, and this causes changes of the recording processing speed.

In a case that the compressed motion image signal is temporarily storedin the memory, the determining means preferably determines the recordingprocessing speed on the basis of a size of the compressed motion imagesignal that is stored in the memory and has not yet been recorded.

A motion image recording apparatus according to this invention,comprising: a fetching means for fetching a motion image signal; acompression means for compressing the motion image signal by apredetermined number of screens to generate a compressed motion imagesignal; a recording means for recording the compressed motion imagesignal in a recording medium; a determining means for periodicallydetermining a processing speed of the recording means; and a changingmeans for changing a compression ratio of the compression means on thebasis of a determination result by the determining means.

The motion image signal fetched by the fetching means is compressed bythe predetermined number of screens by the compression means. Thecompressed motion image signal is recorded in the recording medium bythe recording means. The processing speed of the recording means isperiodically determined by the determining means, and the changing meanschanges the compression ratio of the compression means on the basis ofthe determination result by the determining means. Thus, it is possibleto control the successive recordable time of the motion image.

Preferably, a bus connected to the memory is utilized for transmittingthe motion image signal and the compressed motion image signal. Thezooming means performs an electronic zooming process on the motion imagesignal in a manner selected by the selecting means. The zooming means,when an enlargement zooming is selected by the selecting means, extractsa part of the motion image signal by use of the memory, and performs anenlargement zooming on the extracted motion image signal. Accordingly,when the enlargement zoom is selected, the bus is used for transmittingthe motion image signal, and therefore, an occupation ratio of the busfor transmitting the compressed motion image signal, that is, aprocessing speed of the recording means is decreased.

In a case of temporarily storing the compressed motion image signal inthe memory, the determining means preferably determines the processingspeed on the basis of a size of the compressed motion image signal thatis stored in the memory and has not yet been recorded.

The above described objects and other objects, features, aspects andadvantages of the present invention will become more apparent from thefollowing detailed description of the present invention when taken inconjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing one embodiment of the presentinvention;

FIG. 2 is an illustrative view showing one example of a mapping state ofan SDRAM;

FIG. 3 is an illustrative view showing another example of the mappingstate of the SDRAM;

FIG. 4 is an illustrative view showing one example of a configuration ofan instruction list;

FIG. 5 is an illustrative view showing one example of a configuration ofan access information table;

FIG. 6 is an illustrative view showing one example of a configuration ofa recording medium;

FIG. 7 is an illustrative view showing one example of a configuration ofa free area table;

FIG. 8 is an illustrative view showing a configuration of a movie filein a complete state;

FIG. 9(A) is an illustrative view showing a part of an index informationcreating process;

FIG. 9(B) is an illustrative view showing another part of the indexinformation creating process;

FIG. 9(C) is an illustrative view showing the other part of the indexinformation creating process;

FIG. 10(A) is an illustrative view showing a part of an accessinformation table creating process;

FIG. 10(B) is an illustrative view showing another part of the accessinformation table creating process;

FIG. 10(C) is an illustrative view showing the other part of the accessinformation table creating process;

FIG. 11(A) is an illustrative view showing a part of the indexinformation creating process;

FIG. 11(B) is an illustrative view showing another part of the indexinformation creating process;

FIG. 11(C) is an illustrative view showing the other part of the indexinformation creating process;

FIG. 12(A) is an illustrative view showing a part of the accessinformation table creating process;

FIG. 12(B) is an illustrative view showing another part of the accessinformation table creating process;

FIG. 12(C) is an illustrative view showing the other part of the accessinformation table creating process;

FIG. 13 is a flowchart showing a part of an operation of a CPU when animaging processing task is performed;

FIG. 14 is a flowchart showing another part of the operation of the CPUwhen the imaging processing task is performed;

FIG. 15 is a flowchart showing the other part of the operation of theCPU when the imaging processing task is performed;

FIG. 16 is a flowchart showing a further part of the operation of theCPU when the imaging processing task is performed;

FIG. 17 is a flowchart showing another part of the operation of the CPUwhen the imaging processing task is performed;

FIG. 18 is a flowchart showing the other part of the operation of theCPU when the imaging processing task is performed;

FIG. 19 is a flowchart showing a further part of the operation of theCPU when the imaging processing task is performed;

FIG. 20 is a flowchart showing a part of an operation of the CPU when aBG processing task is performed; and

FIG. 21 is a flowchart showing another part of the operation of the CPUwhen the BG processing task is performed.

BEST MODE FOR PRACTICING THE INVENTION

Referring to FIG. 1, a digital video camera 10 of this embodimentincludes an image sensor 12. An aperture unit and an optical lens thatare not shown are placed at a front of the image sensor 12, and anoptical image of an object is irradiated onto the image sensor 12through these members.

When an imaging mode is selected by a mode change switch 62, acorresponding state signal is applied from a system controller 56 to aCPU 52. The CPU 52 is a multitasking CPU mounting a multitasking OS suchas μITRON, and executes a plurality of tasks such as an imagingprocessing task, an imaging condition controlling task, a BG (BackGround) processing task, etc. in parallel in the imaging mode. Morespecifically, each of the tasks is executed in a time division manneraccording to a priority set in advance and in response to a verticalsynchronization signal described later

In the imaging processing task, an operator can select a desired imagingmode from a plurality of imaging modes by operating a menu key 60. Anyone of a resolution and a frame rate of a captured image, and an audiosystem, a bit rate and a sampling rate of a fetched audio is differentfor each imaging mode. When the desired imaging mode is selected, acorresponding information signal is applied to the CPU 52 from thesystem controller 56. The CPU 52 stores the imaging mode information(resolution, frame rate, audio system, bit rate, sampling rate)indicative of a selected imaging mode and a filename of a movie file tobe created from now in a register rgst.

The CPU 52 further instructs a timing generator (TG) 14 to image at theresolution and the frame rate indicated by the imaging mode information.The TG 14 generates a timing signal according to the desired imagingmode (resolution, frame rate) on the basis of the verticalsynchronization signal and a horizontal synchronization signal outputfrom a signal generator (SG) 16, and drives the image sensor 12 in araster scan manner. A raw image signal (electric charge) having thedesired resolution is output at the desired frame rate from the imagesensor 12, and the output raw image signal is input to a signalprocessing circuit 22 as raw image data being a digital signal through aCDS/AGC circuit 18 and an A/D converter 20.

When a set zoom magnification is “1.0”, the signal processing circuit 22performs a series of signal processing such as a white balanceadjustment, a color separation, a YUV conversion, etc. on the raw imagedata input from the A/D converter 20 to generate YUV data of 1.0 times.When the set zoom magnification is less than “1.0”, the raw image datainput from the A/D converter 20 is first subjected to a reduction zoomby a zoom circuit 22 a, and subjected to the above-described series ofsignal processing after the reduction zoom. The YUV data generated bysuch the processing is stored in the SDRAM 26 via a bus B1 and a memorycontrol circuit 26.

On the other hand, when the set zoom magnification is larger than “1.0”,that is, when an enlargement zooming process is necessary, the zoomcircuit 22 a first temporarily writes the raw image data input from theA/D converter 20 through the bus B1 and the memory control circuit 24 tothe SDRAM 26. The zoom circuit 22 a succeedingly reads the raw imagedata in a part of area required for an enlargement zooming processthrough the bus B1 and the memory control circuit 24 to perform anenlargement zoom on the read raw image data in the part of area. Theenlarged raw image data is converted into the YUV data by theabove-described series of signal processing. Thus, the YUV data having amagnification larger than “1.0” is generated. The generated YUV data isstored in the SDRAM 26 via the bus B1 and the memory control circuit 26.

A video encoder 28 reads the YUV data from the SDRAM 26 through the busB1 and the memory control circuit 24 to encode the read YUV data into acomposite image signal. The encoded composite image signal is applied toa monitor 30, and whereby, a real-time motion image (through-image) ofthe object is displayed on the monitor 30.

In the imaging condition controlling task, the CPU 52 controls animaging condition such as an aperture amount, an exposure time period, awhite balance adjustment gain, an electronic zoom magnification, etc.More specifically, the aperture amount or the exposure time period isadjusted according to brightness of the object, the white balanceadjustment gain is corrected according to a color of the object, and theelectronic zoom magnification is adjusted according to changes of astate signal indicative of an operating state of a zoom key 64. Thus, itis possible to prevent the brightness and the tone of the through-imagefrom changing, and the zoom magnification of the through-image ischanged in response to the operation of the zoom key 64.

It is noted that when the zoom magnification larger than “1.0” isselected by the zoom key 64, a process of temporarily storing the rawimage data in the SDRAM 26 as described above is executed.

When a shutter button 58 is depressed by the operator, and acorresponding state signal is applied from the system controller 56, theCPU 52 creates a movie file storing a captured motion image in arecording medium 50. Here, the recording medium 50 is a detachablerecording medium, and becomes accessible by an I/F 46 when being loadedinto a slot 48. The recording medium 50 is provided with a CPU 50 a, abuffer memory 50 b and a hard disk 50 c, and an FAT area 501 c, a rootdirectory area 502 c and a data area 503 c are formed in the hard disk50 c as shown in FIG. 6. Writing of the data to the data area 503 c isperformed by a predetermined amount via the buffer memory 50 b.

At a time of recording the motion image, the CPU 52 activates the BGprocessing task. At this time, an instruction list 52 a shown in FIG. 4is created in order to enable a smooth process between the imagingprocessing task and the BG processing task.

In the instruction list 52 a, first, a command and parameterscorresponding to each of “BG processing start”, “file creation”, “tablecreation” and “file open” are set. The BG processing task is started by“BG processing start”, and a filename of the movie file and sizeinformation indicative of “0” are written to the root directory area 502c shown in FIG. 6 by “file creation”. In “table creation”, a free areatable 52 c as shown in FIG. 7 is created. According to FIG. 7, a headaddress and a size of each of the free areas formed in the data area 503c are set in descending order of the size. In “file open”, a handlenumber for specifying the movie file to which the data is written iscreated.

When preparing for writing the data is thus completed, the CPU 52performs a thumbnail image capturing process and a header informationcreating process in order to create a movie file header during next oneframe period. First, the signal processing circuit 22 is instructed toperform a thinning-out process, and a JPEG codec 32 is instructed toperform a compression process. The signal processing circuit 22 performsthe thinning-out process in addition to the above-described YUVconversion, and writes thumbnail YUV data thus generated to the SDRAM 26through the bus B1 and the memory control circuit 24. The JPEG codec 32reads the thumbnail YUV data from the SDRAM 26 through the bus B1 andthe memory control circuit 24, and performs a JPEG compression on theread thumbnail YUV data. The JPEG codec 32 then writes JPEG raw data Rthof the thumbnail image generated by the JPEG compression to the SDRAM 26through the bus B1 and the memory control circuit 24.

The CPU 46 creates a JPEG header Hth of the thumbnail image by itselfand, and writes the created JPEG header Hth to the SDRAM 26 through thebus B1 and the memory control circuit 24. The CPU 46 further creates foritself header information Hinf including the above-described imagingmode information, and writes the created header information Hinf to theSDRAM 26 through the bus B1 and the memory control circuit 24. Thus, theJPEG raw data Rth, the JPEG header Hth and the header information Hinfare mapped into the SDRAM 26 as shown in FIG. 2.

In the instruction list 52 a, “file writing” is set. “File writing” isexecuted by the BG process, and whereby, the JPEG raw data Rth, the JPEGheader Hth and the header information Hinf are read from the SDRAM 26,and applied to the recording medium 50 via the bus B1 and the I/Fcircuit 46. Thus, a movie file header shown in FIG. 7 is created in thedata area 503 c shown in FIG. 6. It is noted that JPEG data TH shown inFIG. 7 is formed of the JPEG header Hth and the JPEG raw data Rth.

After completion of creating the movie file header, the CPU 52 performsan image capturing process and an audio fetching process every time thata vertical synchronization signal is generated.

In the image capturing process, the created JPEG header is written tothe SDRAM 26 through the bus B1 and the memory control circuit 24, andan compression instruction is applied to the JPEG codec 32. The JPEGcodec 32, when the compression instruction is applied, reads YUV data ofthe current frame from the SDRAM 26 through the bus B1 and the memorycontrol circuit 24, and compresses the read YUV data up to a targetsize. When JPEG raw data of the current frame is crated by thecompression process, the JPEG codec 32 writes the JPEG raw data to theSDRAM 26 through the bus B1 and the memory control circuit 24.

Here, the target size at a time of the JPEG compression is changedaccording to a recording state to the recording medium 50. That is, if arecording processing speed is low, there is a possibility of a failureof the process due to a bottle neck, and therefore, the recording stateof the recording medium 50 is periodically detected, and the target sizeat a time of the JPEG compression is changed according to the detectionresult. The target size changing process is described later in detail.

In the audio fetching process, a processing instruction is applied to asignal processing circuit 38. The signal processing circuit 38, when theprocessing instruction is applied, writes audio data corresponding toone frame accumulated in an SRAM 38 a to the SDRAM 26 through the bus B1and the memory control circuit 38 a. As a result of execution of suchthe image capturing process and the audio fetching process every oneframe period, the JPEG header, the JPEG raw data and the audio data ofeach frame are mapped into the SDRAM 26 as shown FIG. 2.

It is noted that in FIG. 2, a serial number 0, 1, 2, . . . is applied tothe JPEG header and the JPEG raw data for each frame while the serialnumber 0, 1, 2, . . . is applied to the audio data for each threeframes. Furthermore, one frame of JPEG data is formed by the JPEG headerand the JPEG raw data each having the same number, and markers SOI(Start Of Image) and EOI (End Of Image) are assigned to the head and theend of the JPEG data of each frame as shown in FIG. 8.

The CPU 52 further creates access information of the JPEG raw data,access information of the JPEG header and index information of the JPEGdata every time that one frame period elapses, and creates accessinformation of the audio data and index information of the audio dataevery time that three frames of period elapses.

The access information of the JPEG raw data consists of a data size ofeach frame and a head address on the SDRAM 26, and the accessinformation of the JPEG header also consists of a data size of eachframe and a head address on the SDRAM 26. The index information of theJPEG data consists of a data size of each frame and a distance from thehead of a movie file at a time of being written to the recording medium50.

The access information of the audio data consists of a data sizecorresponding to three frames and a head address on the SDRAM 26, andthe index information of the audio data consists of a data sizecorresponding to three frames and a distance from the head of the moviefile at a time of being written to the recording medium 50.

The access information is created in an access information table 52 bshown in FIG. 5, and the index information is created in the SDRAM 26 asshown in FIG. 3. According to FIG. 5, the SDRAM address and the datasize of three frames of the JPEG raw data, the SDRAM address and thedata size of three frames of JPEG header, and the SDRAM address and thedata size of the audio data corresponding to three frames are relatedwith each other. According to FIG. 3, position information and sizeinformation of the audio data corresponding to three frames, andposition information and size information of three frames of the JPEGdata are alternately mapped into the SDRAM 26.

It is noted that it may be possible that an error of a samplingfrequency of the audio data occurs between a real processing by hardwareand calculation of software. In this embodiment, the index informationand the access information of the JPEG data are subjected to thethinning-out/interpolation in order to complement the difference. Thethinning-out/interpolation process is described later in detail.

The CPU 52 sets “file writing” to the instruction list 52 a on the basisof the above-described access information in order to write the audiodata corresponding to three frames and the JPEG data of three frames tothe recording medium 50. “File writing” is executed by the BGprocessing, and whereby, the audio data corresponding to three framesand the JPEG data of three frames are read from the SDRAM 26, andapplied to the recording medium 50 via the bus B1 and the I/F circuit46. In the data area 503 c of the recording medium 50, an audio chunkconsisting of the audio data corresponding to three frames and an imagechunk consisting of the JPEG data of three frames are recorded. As shownin FIG. 8, the audio chunk and the image chunk are alternately mapped onthe movie file.

When the shutter button 58 is depressed once again, the CPU 52 suspendsthe image capturing and the audio fetching, and sets “file writing” tothe instruction list 52 a in order to record the index informationcreated in the SDRAM 26 as shown in FIG. 3 into the recording medium 50.“File writing” is executed by the BG processing task, and whereby theindex information is read from the SDRAM 26, and applied to therecording medium 50 via the bus B1 and the I/F circuit 46. Thus, anindex chunk shown in FIG. 8 is formed at the end of the movie file. Asto the index chunk, a position in the file and a size of the audio dataare managed every time period corresponding to three frames, and aposition in the file and a size of the JPEG data are managed every oneframe.

After completion of creating the index chunk, the CPU 52 calculates atotal size value of the movie file currently created, and sets “filewriting” to the instruction list 52 a in order to write the calculatedtotal size value to the movie file header. The file writing is executedby the BG processing task, and whereby, the total size value is added tothe header information Hinf of the movie file header to complete thecreation of the movie file satisfying the QuickTime format.

Succeedingly, the CPU 52 sets “file close” and “BG processingtermination” to the instruction list 52 a. When “file close” is executedby the BG processing, size information written in the root directoryarea 502 c and FAT information written in the FAT area 501 c areupdated. More specifically, a filename of a movie file currently createdis detected from a directory entry, and the size information assigned tothe detected filename is updated from “0” to the total size value.Furthermore, the FAT information is updated such that a link is formedin a writing area (cluster) of the movie file currently created. The BGprocess is terminated by “BG processing termination”.

When a reproduction mode is selected by the mode change switch 62, and adesired movie file is selected by the menu key 60, a corresponding statesignal is applied to the system controller 56. The CPU 52 detects theselected movie file from the recording medium 50, and reproduces audiodata and JPEG data within the detected movie file. At this time, areproducing order complies with the index information within the moviefile.

In case the index information created as shown in FIG. 3 exists withinthe movie file, the audio data and the JPEG data are read from therecording medium 50 in the order of the audio data 0, the JPEG data 0-2,the audio data 1, the JPEG data 3-5, . . . . The read audio data andJPEG data are first stored in the SDRAM 26 by the memory control circuit24. The CPU 52 applies an expansion instruction to the JPEG codec 32according to the order of the index information of the JPEG data, andapplies a processing instruction to the signal processing circuit 40 inthe order according to the index information of the audio data.

The JPEG codec 32 reads JPEG raw data forming JPEG data of a desiredframe from the SDRAM 26 through the bus B1 and the memory controlcircuit 24, and performs a JPEG expansion on the read JPEG raw data. YUVdata generated by the JPEG expansion is stored in the SDRAM 26 throughthe bus B1 and the memory control circuit 24, and then applied to thevideo encoder 28 through the bus B1 and the memory control circuit 24.Thus, a corresponding reproduced image is displayed on the monitor 30.

The signal processing circuit 40 reads the audio data corresponding todesired three frames from the SDRAM 26 through the bus B1 and the memorycontrol circuit 24, and accumulates the read audio data in the SRAM 40a. The audio data accumulated in the SRAM 40 a is converted into ananalog audio signal by a D/A converter 42, and the converted audiosignal is output from a speaker 44.

By repeating such the processes, a reproduced motion image is displayedon the monitor 30, and an audio signal synchronizing to the reproducedmotion image is output from the speaker 44.

When the imaging mode is selected, the CPU 52 executes the imagingprocessing task shown in FIG. 13-FIG. 19 and the BG processing taskshown in FIG. 20-FIG. 21 according to the control program stored in theROM 54.

First, referring to FIG. 13, an imaging mode determining process isperformed in a step S1. More specifically, a menu showing a plurality ofimaging modes is displayed on the monitor 30, and a desired imaging modeis determined according to an operation of a menu key 52. When theimaging mode is determined, the process proceeds to a step S3 to createimaging mode information indicative of the determined imaging mode. Thesetting information is rendered, for example, “resolution: VGA”, “framerate: 30 fps”, “audio system: monophonic”, “bit rate: 8 bits”, and“sampling rate: 8040 Hz”. In a step S5, a filename of a movie file to becreated by the current imaging processing task is determined. Thefilename is rendered, for example, “VCLP0003.MOV”. Thecreated/determined imaging mode information and filename are registeredin the register rgst.

In a step S7, each of variables is initialized. More specifically, eachof variables i, frmcnt, flsz, BG_RemData, pre_flsz, t_sz, and aud_sz isset to “0”, a variable trgt_sz is set to a maximum value MAX, and avariable audsz_fps is set to a logical value LG.

Here, each of the variables i and frmcnt is a variable indicative of aframe number. The variable i is continuously incremented in response toa vertical synchronization signal, and the variable frmcnt is circularlyupdated between “0”-“3” in response to a vertical synchronizationsignal. Out of the numerical values “0”-“3” of the variable frmcnt, theactually important numerical value is “0”-“2”. As described above, oneimage chunk is formed of three frames of JPEG data. The variable frmcntis utilized for specifying what number in the image chunk the noticedJPEG data is.

The variable flsz is a variable indicative of the total size value ofthe JPEG raw data generated of the JPEG compression. The variableBG_RemData is a variable indicative of the size of the JPEG raw data forwhich an instruction of “file writing” is set to the instruction list 52a shown in FIG. 4, but that has not yet been recorded in the recordingmedium 50. The variable pre_flsz is a variable indicative of the totalsize value of the JPEG raw data that has already been recorded in therecording medium 50.

The variable trgt_sz is a variable indicative of the target size valuewhen each frame of YUV data is compressed, and the variable t_sz is avariable to be utilized for calculating the target size value.

The variable aud_sz is a variable indicative of the total size value(byte) of the fetched audio data, and the variable audsz_fps is avariable indicative of the size value of the audio data corresponding toone frame. It is noted that the logical value LG set as the variableaudsz_fps is the size value of the audio data corresponding to one framedetermined on the basis of a sampling rate on a calculation by software.For example, if an actual sampling rate of the determined imaging modeis rendered 8043 Hz, the sampling rate on the calculation by thesoftware is rendered 8040 Hz, and the logical value LG is rendered 268(=8040/30) bytes. The numerical value 8040 Hz is based on the facts thatdata transmission by hardware is executed by one word (=4bytes) unit,and the logical value LG can be represented by an integer.

In a step S9, a processing instruction is applied to each of the TG 14,the signal processing circuit 22 and the video encoder 28 to perform athrough-image display. A through-image of the object is displayed on themonitor 30. When the shutter button 58 is depressed by the operator in astate that the through-image is displayed, “BG processing start”, “filecreation”, “table creation” and “file open” are set to the list number“0”-“3”of the instruction list 52 a shown in FIG. 4 in the stepsS11-S19, respectively. TABLE 1 PARAMETER PARAMETER PARAMETER PARAMETERKIND COMMAND 1 2 3 4 BG PROCESSING FILE_STRT — — — — START FILE CREATIONFILE_CREATE DRIVE FILE PATH — — NUMBER TABLE FILE_SET_(—) DRIVE — — —CREATION ALLOC NUMBER FILE OPEN FILE_OPEN DRIVE FILE PATH — — NUMBERFILE WRITING FILE_WRITE HANDLE SDRAM SIZE (byte) DATA KIND NUMBERADDRESS FILE CLOSE FILE_CLOSE — — — — BG PROCESSING FILE_END — — — — END

Referring to the table 1, in “BG processing start”, FILE_STRT is set asa command, and in “file creation”, FILE_CREATE, a drive number (thenumber of drive for driving the recording medium 44), and a file pathare set as the command, parameters 1 and 2, respectively. Furthermore,in “table creation”, FILE_SET_ALLOC and a drive number are set as thecommand and the parameter 1, and in “file open”, FILE_OPEN, a drivenumber and a file path are set as the command, the parameters 1 and 2.The size information and the filename determined in a step S25 areincluded in the file path set by “file creation”, and the sizeinformation and the filename are written to the directory entry. It isnoted that the movie file has not yet been completed, and therefore, thesize information indicates “0”.

When a vertical synchronization signal is output from the SG16 aftercompletion of the process in the step S19, “YES” is determined in a stepS21, and the value of the variable i is identified in a step S23. Here,if the variable i is equal to or more than “1”, the process directlyproceeds to a step S31 while if the variable i is equal to “0”, theprocess proceeds to the step S31 through the processes in steps S25-S29.

In the step S25, a capturing process of a thumbnail image is performed.More specifically, a JPEG header Hth created by the CPU 52 is written tothe SDRAM 26, and a thinning-out process and a compression process arerespectively instructed to the signal processing circuit 22 and the JPEGcodec 32.

The signal processing circuit 22 performs the thinning-out process onYUV data during one frame period, and writes thumbnail YUV data thusgenerated to the SDRAM 26 through the bus B1 and the memory controlcircuit 24. The JPEG codec 32 reads the thumbnail YUV data from theSDRAM 26 through the bus B1 and the memory control circuit 24, performsthe JPEG compression process on the read thumbnail YUV data to generateJPEG raw data Rth, and writes the JPEG raw data Rth to the SDRAM 26through the bus B1 and the memory control circuit 24. The JPEG headerHth and the JPEG raw data Rth are mapped on the SDRAM 26 as shown inFIG. 2.

In the succeeding step S27, header information Hinf including theabove-described imaging mode information (resolution, frame rate, audiosystem, bit rate, sampling rate) is created, and the header informationHinf is written to the SDRAM 26 through the bus B1 and the memorycontrol circuit 24. The header information Hinf is mapped above the JPEGheader Hth as shown in FIG. 2.

When the header information Hinf, the JPEG header Hth and the JPEG rawdata Rth forming the movie file header are thus stored in the SDRAM 26,“file writing” is set to the column of each of the list number “4” and“5” of the instruction list 52 a shown in FIG. 4 in the step S29. As canbe understood from the table 1, in “file writing”, a FILE_WRITE, ahandle number (obtained by a file open processing), an SDRAM address, adata size and a data classification are set as the command and theparameters 1, 2, 3 and 4. The reason why two “file writing” are set isthe header information Hinf and the JPEG header Hth are continuous inthe SDRAM 26, but the JPEG raw data Rth is stored in a separateposition.

In the column of the list number “4”, a start address of the headerinformation Hinf is set as the SDRAM address, a total size of the headerinformation Hinf and the JPEG header Hth is set as the data size, and“movie file header” is set as the data classification. Furthermore, inthe column of the list number “5”, a start address of the JPEG raw dataRth is set as the SDRAM address, a size of the JPEG raw data Rth is setas the data size, and a “movie file header” is set as the dataclassification. Thus, on the movie file header shown FIG. 8, the headerinformation Hinf, the JPEG header Hth and the JPEG raw data Rth aresuccessive in this order. It is noted that the JPEG data TH is formed ofthe JPEG header Hth and the JPEG raw data Rth as described above.

In the step S31, a compression processing instruction is applied to theJPEG codec 32. The compression processing instruction includes a targetsize value according to the variable trgt_sz. The JPEG codec 32 readsone frame of YUV data from the SDRAM 26 through the bus B1 and thememory control circuit 24, performs a compression process on the readYUV data to create JPEG raw data having a size being approximate to thetarget size, and writes the generated JPEG raw data to the SDRAM 26through the bus B1 and the memory control circuit 24. The JPEG raw datais mapped on the SDRAM 26 as shown in FIG. 2. As described above, theJPEG data of the frame is formed of the JPEG header and the JPEG rawdata obtained in the same frame, and the makers of SOI and EOI arewritten to the head and the end of the JPEG data.

In a step S33, a processing instruction is applied to the signalprocessing circuit 38 in order to perform a fetching process of theaudio data corresponding to one frame. The signal processing circuit 38writes the audio data corresponding to one frame that is applied fromthe A/D converter 36 and retained in the SRAM 38 a to the SDRAM 26through the bus B1 and the memory control circuit 24. The audio data ismapped on the SDRAM 26 as shown in FIG. 2. The signal processing circuit38 further returns to the CPU 52 a fetched size value that is a sizevalue of the audio data written to the SDRAM 26. Thus, in a step S35, anarithmetic operation according to the equation 1 is executed toaccumulate the returned fetched size value to the variable aud_sz.aud _(—) sz=aud _(—) sz+fetched size value   [Equation 1]

After completion of the arithmetic operation of the equation 1, it isdetermined whether or not the JPEG compression is completed in a stepS37. The JPEG codec 32, after completion of the JPEG compression on thebasis of the compression instruction in the step S31, returns acompressed size value that is a size value of the generated JPEG rawdata and a compression termination signal to the CPU 46. Thus, when thecompression termination signal is returned, “YES” is determined in thestep S37.

In a step S39, an arithmetic operation of the equation 2 is executed inorder to add the returned compressed size value to the variable flsz.flsz=flsz+compressed size value   [Equation 2]

In a step S41, a JPEG header created by the CPU 52 is written to theSDRAM 26 through the bus B1 and the memory control circuit 24, and in asucceeding step S43, index information of the JPEG data of the currentframe is written to the SDRAM 26 through the bus B1 and the memorycontrol circuit 24. The JPEG header is mapped on the SDRAM 26 as shownin FIG. 2, and the index information is mapped on the SDRAM 26 as shownin FIG. 3.

As described above, in the index chunk of the movie file, the positionon the file and the size of the JPEG data are managed for each frame.Thus, in the step S43, the position information and the size informationof one frame of JPEG data are created as the index information.Furthermore, in the movie file, one image chunk is formed of threeframes of JPEG data. Thus, in the step S43, what number the currentframe is out of successive three frames is specified from the variablefrmcnt, and whereby, which position the index information is to becreated in the SDRAM 26 is determined.

In a step S45, the access information of the JPEG raw data and the JPEGheader of the current frame is created within the access informationtable 52 b shown in FIG. 5. That is, the head address information andthe size information of the JPEG raw data of the current frame existingin the SDRAM 26 are created as the access information of the JPEG rawdata of the current frame, and the head address information and the sizeinformation of the JPEG header of the current frame existing in theSDRAM 26 are created as the access information of the JPEG header of thecurrent frame. Each of the created access information is assigned to thevariable i set in the access information table 52 b.

After completion of the process in the step S45, the variable i iscompared to the frame rate value FPS of the current imaging mode in astep S47. If the frame rate of the current imaging mode is 30 fps, theframe rate value FPS becomes “30”, and the variable i is compared to“30”. Then, if i<FPS, the process directly proceeds to a step S83 whileif i≧FPS, the process proceeds to a step S81 through the process in thesteps S49-S81.

In the step S49, it is determined whether or not the variable frmcnt isless than “2”, and if “YES”, it is determined whether or not a conditionof the equation 3 is satisfied in the step S51. On the other hand, ifthe variable frmcnt is equal to or more than “2”, it is determinedwhether or not a condition of the equation 4 is satisfied in the stepS59.aud _(—) sz-(audsz_fps*(i+1))>audsz_fps   [Equation 3](audsz_fps*(i+1))-aud _(—) sz>audsz_fps   [Equation 4]

The aud_sz is a total size value of the audio data actually fetched, andthe audsz_fps*(i+1) is a value obtained by multiplying the number offrames from the start of fetching by the logical value LG. In each ofthe equation 3 and the equation 4, a difference value between both thenumerical values is compared to the logical value LG. As far as thedifference value is equal to or less than the logical value LG, theprocess directly proceeds to the step S63 while if the difference valueis above the logical value LG, the process proceeds to the step S63through the steps S53-S57, or the step S61.

For example, if the actual sampling rate is 8043 Hz, and the samplingrate on the calculation by the software is 8040 Hz, the error betweenthem is 3 Hz. Then, the error of 3 bytes occurs to the size value of theaudio data corresponding to one second. Since the logical value LG is268 bytes, the condition of the equation 3 is satisfied per about 90seconds, and therefore, the processes in the steps S53-S57 are executed.Furthermore, if the actual sampling rate is 8034 Hz, and the samplingrate on the calculation by the software is 8040 Hz, the error betweenthem is 6 Hz. At this time, the condition of the equation 4 is satisfiedper about 45 seconds, and therefore, the process in the step S61 isexecuted.

In the step S53, each of the variables i and frmcnt is incremented. Inthe step S55, the image index information equal to the preceding one,that is, the index information equal to one created in the immediatelypreceding step S43 is created in the SDRAM 26, and in the step S57, theaccess information equal to the preceding one, that is, the accessinformation equal to one created in the immediately preceding step S45is created in the access information table 52 b. After completion of theprocess in the step S57, the process proceeds to the step S63. On theother hand, in the step S61, each of the variables i and frmcnt isdecremented, and then, the process proceeds to the step S63.

Accordingly, in a case that the condition shown in the equation 3 issatisfied, after the index information is set to the SDRAM 26 as shownin FIG. 9(A), and the access information is set to the accessinformation table 52 b as shown in FIG. 10(A), by the processes in thesteps S53-S57, the index information of the same JPEG data is set to theSDRAM 26 as shown in FIG. 9(B), and the access information of the JPEGraw data and the JPEG header that form the same JPEG data is set to theaccess information table 52 b as shown in FIG. 10(B).

According to FIG. 9(A), the index information of the JPEG data P is setto the SDRAM 26. In this state, the variable frmcnt is incremented, andthe index information created in the immediately preceding step S43 isvalidated once again, and therefore, the index information of the JPEGdata P is interpolated as shown in FIG. 9(B). After the indexinformation of the JPEG data P is interpolated, the index information ofthe JPEG data P+1 is set as shown in FIG. 9(C).

According to FIG. 10(A), the access information of the JPEG raw data Pand the JPEG header P are assigned to the variable i (=P). In thisstate, the variable i is incremented, and the access information createdin the immediately preceding step S45 is validated once again, andtherefore, the access information of the JPEG raw data P and the JPEGheader P are assigned to the variable i (=P+1) as shown in FIG. 10(B).After the access information of the JPEG raw data P and the JPEG headerP are interpolated, the access information of the JPEG raw data P+1 andthe JPEG header P+1 are assigned to the variable i (=P+2) as shown inFIG. 10(C).

On the other hand, in a case that the condition shown in the equation 4is satisfied, after the index information is set to the SDRAM 26 asshown in FIG. 11(A), and the access information is set to the accessinformation table 52 b as shown in FIG. 12(A), by the process in thestep S61, a part of the index information is overwritten by thefollowing index information as shown in FIG. 11(B), and a part of theaccess information is overwritten by the following access information asshown in FIG. 12(B).

According to FIG. 11(A), the index information of the JPEG data P andthe index information of the JPEG data P+1 are set to the SDRAM 26.Since the variable frmcnt is decremented in this state, by the processin the step S43 at the next time, the index information of the JPEG dataP+1 is overwritten with the index information of the JPEG data P+2 asshown in FIG. 11(B). Thus, the index information of the JPEG data P+1 isthinned-out. Next to the index information of the JPEG data P+2, theindex information of the JPEG data P+3 is set as shown in FIG. 11(C).

According to FIG. 12(A), the access information of the JPEG raw data Pand the JPEG header P, and the access information of the JPEG raw dataP+1 and the JPEG header P+1 are set to the access information table 52b. Since the variable i is decremented in this state, by the process inthe step S45 at the next time, the access information of the JPEG rawdata P+1 and the JPEG header P+1 is overwritten with the accessinformation of the JPEG raw data P+2 and the JPEG header P+2 as shown inFIG. 12(B). Thus, the access information of the JPEG data P+1 isthinned-out. Next to the access information of the JPEG raw data P+2 andthe JPEG header P+2, the access information of the JPEG raw data P+3 andJPEG header P+3 are set as shown in FIG. 12(C).

It is noted that the variable i is incremented in the step S53, andwhereby, determination of “NO” is continued in the step S51 at and afterthe next time. Furthermore, the variable i is decremented in the stepS61, and whereby, determination of “NO” is continued in the step S59 atand after the next time.

In the step S63, a remainder (=i% FPS) obtained by dividing the variablei by the frame rate value FPS is identified. Here, if the remainder isnot “0”, the process directly proceeds to the step S83 while if theremainder is “0”, the process proceeds to the step S83 through theprocess in the steps S65-S81. Since the remainder becomes “0” every 30frames, the process in the steps S65-S81 is executed per 30 frames.

In the step S65, the variables flsz and pre_flsz are subjected to anarithmetic operation according to the equation 5, and in the step S67, adifference value Δflsz obtained by the equation 5, the variableBG_RemData, and the frame rate value FPS are subjected to an arithmeticoperation according to the equation 6.Δflsz=flsz-pre_flsz   [Equation 5]t _(—) sz=(Δflsz-BG _(—) RemData)/FPS   [Equation 6]

In the equation 5, the variable flsz is the total size value of the JPEGraw data obtained by the JPEG compression, and the variable pre_flsz isthe total size value of the JPEG raw data that has already been recordedin the recording medium 50. As described later, the variable pre_flsz isonly updated every 30 frames, and the arithmetic operation according tothe equation 5 is also updated every 30 frames, and therefore, thedifference value Δflsz indicates the total size of the JPEG raw datagenerated in the newest 30 frames.

In the equation 6, the variable BG_RemData is a total size value of theJPEG raw data for which an instruction of “file writing” is set to theinstruction list 52, but that has not yet been recorded in the recordingmedium 50. The shorter a time required for the “file writing” processis, the smaller the variable BG_RemData is while the longer a timerequired for “file writing” process is, the larger it is. A subtractedvalue obtained by subtracting the variable BG_RemData from thedifference value Δflsz reflects a processing speed of “file writing” atthis time, and a divided value obtained by dividing the subtracted valueby the frame rate value FPS is a compressed size value in which anamount of changes of the variable BG_RemData at the current processingspeed falls within a defined range. Such the compressed size value iscalculated as a variable t_sz.

Here, as a variable factor of a processing speed of “file writing”, anoccupation rate of the bus B1 and a processing state of the task exceptfor the BG processing task are conceivable other than the processingspeed of the CPU 50 a, and characteristics of the recording medium 50such as a capacity of the buffer memory 50 b.

As described above, when the zoom magnification larger than “1.0” isselected by an operation of the zoom key 64, raw image data istemporarily stored in the SDRAM 26, and then input to the signalprocessing circuit 22. At this time, the raw image data is applied tothe SDRAM 26 via the bus B1, and returned to the signal processingcircuit 22 via the bus B1. The occupation rate of the bus B1 isincreased by a transfer process of the raw image data, and thus, thislowers the processing speed of “file writing”.

Furthermore, when brightness and a tone are considerably changed bypanning or tilting of the camera, the imaging condition controlling taskis activated to adjust an aperture amount, an expose time period, awhite balance adjustment gain, etc. Since the respective tasks cannot besimultaneously executed, when the imaging condition controlling task isactivated, the BG processing task is interrupted, and whereby, theprocessing speed of “file writing” is lowered.

In this embodiment, taking the changes in the processing speed of “filewriting” into account, the variable t_sz is periodically updated. As aresult of updating the variable t_sz, the target size value and, inturn, the JPEG compression ratio are updated as described later.

In the step S69, the calculated variable t_sz is compared to thevariable trgt_sz, and if t_sz<trgt_sz, the variable t_sz is compared toa minimum value MIN in the step S71. Then, if t_sz≧MIN, the processdirectly proceeds to the step S79 while if t_sz<MIN, the variable t_szis updated to the minimum value MIN in the step S73, and then, theprocess proceeds to the step S79. On the other hand, if it is determinedto be t_sz≧trgt_sz in the step S69, the variable t_sz is compared to amaximum value MAX in the step S75. Then, if t_sz≦MAX, the processdirectly proceeds to the step S79 while if t_sz>MAX, the variable t_szis updated to the maximum value MAX in the step S77, and then, theprocess proceeds to the step S79. In the step S79, the variable t_sz isset as the variable trgt_sz.

According to the equation 6, when the variable BG_RemData is large, thevariable t_sz is small while when the variable BG_RemData is small, thevariable t_sz is large. Therefore, “t_sz<trgt_sz” means that a largeamount of the JPEG data that has not yet been recorded exist, that is, aprocessing speed of “file writing” is low. Furthermore, “t_sz≧trgt_sz”means that a small amount of the JPEG data that has not yet beenrecorded exist, that is, characteristics of the recording medium 50 issuperior.

Here, when the variable t_sz is below the variable trgt_sz, the variablet_sz is set as the variable trgt_sz in order to validate a smallertarget size value (higher JPEG compression ratio) during successive onesecond. Thus, the size of the JPEG data generated during a successiveone second is smaller than the size of the JPEG data generated duringthe current one second, and fail of the process due to the decrease inthe processing speed of “file writing” is prevented.

On the other hand, when the variable t_sz is equal to or more than thevariable trgt_sz, the variable t_sz is set to the variable trgt sz inorder to validate a larger target size value (lower JPEG compressionratio) during the successive one second. Thus, the size of the JPEG datagenerated during the successive one second is larger than the size ofthe JPEG data generated during the current one second, and deteriorationof image quality due to the compression process is prevented.

In the step S81, the variable flsz and BG_RemData is subjected to anarithmetic operation according to the equation 7 to update the variablepre_flsz.pre₁₃ flsz=flsz-BG_RemData   [Equation 7]

According to the equation 7, the total size value of the JPEG raw datathat has not yet been recorded is subtracted from the total size valueof the JPEG raw data generated by now. The arithmetic operation is alsoexecuted every 30 frames, and therefore, the variable pre_flsz isupdated every 30 frames. In the arithmetic operation of the equation 5at the nex time, that is, after the thirty frames, the variable pre_flszthus updated is subtracted from the newest variable flsz.

The variable frmcnt is incremented in the step S83, and the value of theincremented variable frmcnt is identified in a succeeding step S85.Then, if the variable frmcnt is “1” or “2”, the process directlyproceeds to a step S95 while the variable frmcnt is “3”, the processproceeds to the step S95 through the process in steps S87-S93.

In the step S87, the index information of the audio data is written tothe SDRAM 26. In the movie file shown FIG. 7, one audio chunk is formedof the audio data corresponding to three frames of time period. In theindex chunk, the position in the file and the size of the audio data aremanaged every time period corresponding to three frames. Thus, in thestep S85, the position information and the size information of the audiodata corresponding to the newest three frames are created, and thecreated index information are written to the SDRAM 26 as shown FIG. 3.

In the succeeding step S89, the access information of the audio data iswritten to the access information table 52 b. That is, the head addressinformation and the size information of the audio data corresponding tothree frames that exist in the SDRAM 26 are created as the accessinformation, and the created access information is written to the accessinformation table 52 b. At this time, the access information is relatedto the access information of the JPEG data of the noticed three frames.

In the step S91, “file writing” is set to the instruction list 52 ashown in FIG. 4 referring to the access information of three frames ofthe JPEG raw data and three frames of the JPEG header, and the accessinformation of the audio data corresponding to three frames that are setin the access information table 52 b. As shown in FIG. 2, the audio datacorresponding to three frames is successive in the SDRAM 26, but threeframes of the JPEG raw data and the JPEG header are discretelydistributed on the SDRAM 26. Thus, in the step S91, a total of seven“file writing” is set to the instruction list 52 a.

In “file writing” set to be first out of the seven “file writing”, theSDRAM address indicates a start address of the audio data correspondingto the noticed three frames, the data size indicates a size of the audiodata corresponding to the noticed three frames, and the dataclassification indicates audio chunk. Here, the start address and thedata size are equal to the SDRAM address and the data size constitutingthe access information created in the step S87.

In “file writing” set to be the second, the forth, and the sixth, theSDRAM address indicates a start address of the JPEG header of each ofthe noticed three frames, the data size indicates a size of the JPEGheader of each of the noticed three frames, and the data classificationindicates JPEG header. Here, the start address and the data size areequal to the SDRAM address and the data size constituting the accessinformation of the JPEG header of each of the newest three framescreated in the step S45 or S57.

In “file writing” set to be third, fifth and seventh, the SDRAM addressindicates a start address of the JPEG raw data of each of the noticedthree frames, the data size indicates a size of the JPEG raw data ofeach of the noticed three frames, and the data classification indicatesJPEG raw data. Here, the start address and the data size are equal tothe SDRAM address and the data size constituting the access informationof the JPEG raw data of each of the newest three frames created in thestep S45 or S57.

Such instructions in the instruction list 52 a are executed by the BGprocessing task, and whereby, the audio data corresponding to threeframes and the JPEG data corresponding to three frames are read-out fromthe SDRAM 26 by the memory control circuit 24, and applied to therecording medium 50 through the bus B1 and the I/F circuit 46.Consequently, the audio chunk and the image chunk are alternatelydistributed in the movie file shown in FIG. 8.

In the step S93, an arithmetic operation of the equation 8 is executedin order to add the size values of three frames of the JPEG raw data setin the instruction list 52 a in the step S91 to the variable BG_RemData.BG _(—) RemData=BG _(—) RemData+size values of JPEG raw data   [Equation8]

In the step S95, the frame number i is incremented, and in a succeedingstep S97, it is determined whether or not the shutter button 58 isoperated. As far as the shutter button 58 is not depressed, the processfrom the step S21-S95 is repeated, and the JPEG header, the JPEG rawdata and the audio data generated for each frame are mapped on the SDRAM26 as shown in FIG. 2.

When the shutter button 58 is depressed, the process proceeds to a stepS99 to determine the value of the variable frmcnt. Here, if the variablefrmcnt is “3”, the process directly proceeds to a step S103 while if thevariable frmcnt is “1” or “2”, “file writing” is set to the instructionlist 52 a in a step S101, and then, the process proceeds to the stepS103.

In a case that the variable frmcnt is “1”, the last audio chunk andimage chunk are respectively formed of one frame of audio data and JPEGdata, and a total of three “file writing” is set to the instruction list52 a. In a case that the variable frmcnt is “2”, the last audio chunkand image chunk are respectively formed of two frames of audio data andJPEG data, and a total of five “file writing” is set to the instructionlist 52 a. Thus, the audio chunk consisting of one frame or two framesof audio data and the image chunk consisting of one frame or two framesof JPEG data are formed in the movie file.

In the step S103, “file writing” is set to the instruction list 52 a inorder to write the index information shown in FIG. 3 to the movie file.The SDRAM address and the data size set here indicate the start addressand the total size of the index information shown in FIG. 3, and thedata classification indicates movie file header. “File writing” isexecuted by the BG processing, and whereby, the index chunk includingall the index information shown in FIG. 3 is formed at the end of themovie file.

In a step S105, the total size of the movie file is calculated on thebasis of the size information included in the index information, and thecalculated total size data is written to the SDRAM 26. In succeedingsteps S107-S111, “file writing”, “file close” and “BG processingtermination” are set to the instruction list 52 a. The SDRAM address andthe data size set by “file writing” indicate the head address and thedata size of the total size data, and the data classification indicatesmovie file header. Furthermore, in “file close”, FILE_CLOSE is set as acommand, and in “BG processing termination”, FILE_END is set as acommand.

“File writing” is executed by the BG processing, and whereby, a totalsize value is added to the size information of the movie file header.Furthermore, “file close” is executed by the BG processing, and whereby,the size information of the directory entry (size information written onthe basis of the process in the step S15) is updated from “0” to thetotal size value, and the FAT information in the FAT area 501 c isupdated such that a link is formed among the writing area of the moviefile currently created. The BG processing is terminated by the “BGprocessing termination”.

It is noted that it is necessary to update a writing destination addressin order to write the total size value to the movie file header, andactually, before setting “file writing” in the step S105, “seekprocessing” is set to the instruction list 52 a.

The BG processing task complies with a flowchart shown in FIG. 20-FIG.21. First, a list number L of a read destination is set to “0” in a stepS121, and it is determined whether or not a command read from the listnumber L is FILE_STRT in a succeeding step S123. If “YES” here, the listnumber L is incremented in a step S125, and the content of the commandread from the incremented list number L is determined in each of stepsS127, S131, S135, S139, and S147.

If the read command is FILE_CREATE, “YES” is determined in the stepS127, and a file creating process is performed in a step S129. Morespecifically, the recording medium 50 is specified by the drive numberset in the parameter 1, and the filename and the size informationindicative of size 0 are written to the directory entry of the recordingmedium 50 on the basis of the file path set to the parameter 2. Aftercompletion of the process, the process returns to the step S125.

If the read command is FILE_SET_ALLOC, “YES” is determined in the stepS131, and a table creating process is performed in the step S133. Thatis, the recording medium 50 is specified by the drive number set in theparameter 1, and the free area table 52 c shown FIG. 7 is createdreferring to the FAT information. After completion of the process, theprocess returns to the step S125.

If the read command is FILE_OPEN, the process proceeds from the stepS135 to a step S137 to perform a file opening process. That is, therecording medium 50 is specified by the drive number set to theparameter 1, a file is specified on the basis of the file path set tothe parameter 2, and a handle number to be assigned to the file iscreated. The created handle number is utilized for the imagingprocessing. After completion of the process, the process returns to thestep S125.

If the read command is FILE_WRITE, the process proceeds from the stepS139 to a step S141 to perform a file writing process. Morespecifically, a movie file of a writing destination is specified by thehandle number set to the parameter 1, and a reading start address and areading size are respectively specified according to the SDRAM addressand the data size set to the parameters 2 and 3. Then, data is read fromthe SDRAM 26 by a word unit on the basis of the reading start addressand the reading size, and the read data is applied to the CPU 50 a ofthe recording medium 50 together with the movie file information of thewrite destination.

If the read size set to the parameter 3 is larger than the buffer memory50 b provided in the recording medium 50, a BUSY signal is returned tothe CPU 52 form the CPU 50 a at a time that the buffer memory 50 bbecomes full. The process in the step S141 is suspended in response tothe BUSY signal. When the buffer memory 50 b has an enough free areaowing to the data transfer from the buffer memory 50 b to the hard disk50 c, a READY signal is returned to the CPU 52 from the CPU 50 a. Theprocess in the step S141 is restarted in response to the READY signal.

After completion of transferring the data corresponding to the read sizeset to the parameter 3 to the recording medium 50, the read size isaccumulated, and the FAT information indicative of a link state of thewritten cluster is created every time that one cluster of writing iscompleted. The accumulated value of the data size and the FATinformation are retained in the SDRAM 26.

In a step S143, the data classification set in the parameter 4 isdetermined. Here, if the data classification is not “JPEG raw data”, theprocess directly returns to the step S125 while if the dataclassification is “JPEG raw data”, an arithmetic operation according tothe equation 9 is executed in a step S145, and then, the process returnsto the step S125.BG_RemData=BG_RemData-size value of JPEG raw data   [Equation 9]

According to the equation 9, the data size set to the parameter 3 issubtracted from the variable BG_RemData. Thus, the variable BG_Rem Dataindicates a size of the JPEG raw data that has been set to theinstruction list 52 a, but has not yet been recorded in the recordingmedium 50.

If the read command is FILE_CLOSE, the process proceeds from the stepS147 to a step S149 to perform a file closing process. Morespecifically, the size information assigned to the filename of theopened movie file is updated by the total size value retained in theSDRAM 26, and the FAT information in the FAT area 501 c is updated bythe FAT information retained in the SDRAM 26. After completion of theprocess, the process returns to the step S125.

If the read command is FILE_END, “NO” is determined in the step S147,and then, the process returns to the step S121. The BG process isshifted to a wait state.

As can be understood from the above-description, the plurality of framesof YUV data forming a motion image is recorded in a compressed manner inthe recording medium 50 under the control of the CPU 52 mounting amultitasking OS. Here, the plurality of tasks to be executed by the CPU52 includes an imaging processing task in relation to a compressionprocess of the YUV data of the plurality of frames, and a BG processingtask in relation to a recording process of the JPEG data of theplurality of frames. Furthermore, the imaging processing task includes adetermining process for periodically determining a recording processingspeed of the JPEG data (S63) and a changing process for changing thecompression ration of the YUV data on the basis of the determinationresult (S79).

In the multitasking OS, the plurality of tasks are executed only in atime division manner. Then, according to load changes of each of thetasks, the recording processing speed of the JPEG data is also changed.Furthermore, the zoom circuit 22 a, when an enlargement zooming isselected by the zoom key 64, writes row image data to the SDRAM 26through the bus B1 and the memory control circuit 24, reads a part ofthe raw image data through the bus B1 and the memory control circuit 24,and is subjected to the enlargement zooming on the read raw image data.Thus, even when the enlargement zooming is selected, due to reduction inan occupation rate of the bus B1, the recording processing speed islowered. This is the reason why in this embodiment, the recordingprocessing speed is periodically determined, and the compression ratioof the YUV data is changed according to a determination result. This, itis possible to control a successive recordable time of the motion image.

It is noted that although the image compression is performed inaccordance with the JPEG format in this embodiment, it may be possiblethat the MPEG format is adopted in place of the JPEG format, and thetarget size value is updated by a GOP unit.

Furthermore, in this embodiment, the target size value is updated every30 frames. However, in order to easily perform the calculation bysoftware, the target size may be updated every the number of framescorresponding to power of two such as 32 frames, 64 frames, 128 frames,etc.

In addition, although the threshold value for determining whether or notthe number of frames is to be adjusted is set to an amount of audio datacorresponding to one frame (=268 bytes) in this embodiment, thethreshold value may be an integral multiple of 268 bytes.

Furthermore, although the number of frames of the JPEG data is adjustedat a time of performing the recording process in this embodiment, theadjustment of the number of frames may be performed at a time ofperforming the reproduction process.

Furthermore, although the thinning-out/interpolation is performed onboth of the access information and the index information in thisembodiment, the thinning-out/interpolation may be performed on only theindex information in a case of controlling a reproduction order of theJPEG data on the basis of only the index information. Thus, it ispossible to eliminate omission of the JPEG data due to the thinning-outprocess of the access information.

In addition, although the FAT format is adopted as a recording format ofa motion image signal in this embodiment, the UDF (Universal DiskFormat) format may be adopted in place of this.

Furthermore, although a description is made by use of the digital videocamera in this embodiment, it is needless to say that the presentinvention is applicable to a fixed-typed hard disk recorder, forexample, for recording a TV program.

Although the present invention has been described and illustrated indetail, it is clearly understood that the same is by way of illustrationand example only and is not to be taken by way of limitation, the spiritand scope of the present invention being limited only by the terms ofthe appended claims.

1. A motion image recording apparatus which comprises a processor mounting a multitasking OS, and records a plurality of screens of image data forming a motion image signal in a compressed manner in a recording medium, wherein a plurality of tasks to be executed by said processor includes a first task in relation to a compression process of image data, and a second task in relation to a recording process of compressed image data, said first task includes an increasing process for increasing a predetermined parameter value every time that image data corresponding to a first number of screens is compressed, said second task includes a decreasing process for decreasing said predetermined parameter value every time that compressed image data corresponding to a second number of screens is recorded, and said first task includes a changing process for changing a compression ratio of the image data on the basis of said predetermined parameter value.
 2. A motion image recording apparatus according to claim 1, wherein said second task further includes a transmission process for transmitting the compressed image data by a defined amount to a recording medium.
 3. A motion image recording apparatus according to claim 1, further comprising a fetching means for fetching said plurality of screens of image data according to a fetching condition, wherein said plurality of tasks include a third task in relation to an adjustment of said fetching condition.
 4. A motion image recording apparatus according to claim 3, wherein said fetching means includes an imaging means for imaging an object, and said fetching condition includes an imaging condition of said imaging means.
 5. (canceled)
 6. (canceled)
 7. A motion image recording apparatus according to claim 10, comprising: a bus to be utilized for transmitting the image data and the compressed image data; a memory for storing the image data and the compressed image data that are transmitted through said bus; a zooming means for performing an electric zooming process on the image data; and a selecting means for arbitrarily selecting a zooming manner of said zooming means, wherein said zooming means, when an enlargement zooming is selected by said selecting means, extracts a part of the image data by use of said memory, and performs the enlargement zooming on the extracted motion image data.
 8. (canceled)
 9. A motion image recording apparatus according to claim 1, wherein said predetermined parameter value is an accumulated value of a size of the compressed image data.
 10. A motion image recording apparatus comprising: a fetching means for fetching a plurality of screens of image data forming a motion image; a compression means for compressing the image data of each of screens fetched by said fetching means with reference to a target size; a recording means for recording compressed image date generated by said compression means in a recording medium; a first detecting means for detecting a first size value indicative of a total size of the compressed image data corresponding to a newest predetermined number of screens; a second detecting means for detecting a second size value indicative of a total size of the compressed image data that has already been created by said compression means and has not yet been recorded by said recording means; a dividing means for dividing a difference value obtained by subtracting said second size value from said first size value by said predetermined number; and a setting means for setting a divided value obtained by said dividing means as said target size. 